<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <style type="text/css">
        @media print {
            form.tiao { top: -190px !important;left: -80px !important}
            label.tit, label.tit0, div#czdiv {display: none !important}
            label#bz{border:none!important}
        }
        @media screen {
            form.tiao {
                top: -20px !important;
                left: -60px !important
            }

            div#czdiv label {
                margin-right: 20px;
                display: none;
            }

            div#czdiv label:hover {
                cursor: pointer;
                font-weight: bold
            }
        }
        body {margin: 0;padding: 0 !important}
        form label {position: absolute !important;color: #000;font-size: 20px}
        form label.tit, label.tit0 {color: #bbb !important}
        label#bz{display:inline-block;min-height:20mm;min-width:150mm;border:1px dotted #999}
        @media print {
            form.tiao { top: -60px !important;left: -120px !important}  }
    </style>
</head>
<body>
<div id="czdiv" style="width:95%;height:20px;padding:20px 50px 15px;position:absolute;border-bottom:1px dashed #333">
    <label id="da0"><input type="radio" name="dashui" value="0" /></label>
    <label id="da1"><input type="radio" name="dashui" value="1" /></label>
    <label id="da2"><input type="radio" name="dashui" value="2" /></label>
        <label id="daczr"><input type="radio" name="dashui" value="5" />打印-持证人</label>
    <label id="daall" gid="all">重打</label>
<!--    <label id="darq" gid="0"><input type="radio" name="dashui" value="4" />打印发证日期</label>-->
    <label id="buda" style="display:inline"><input type="radio" name="dashui" value="10"  />标识为补发</label>
    <button type="button" style="margin-right:30px;width:80px;height:28px;font-size:18px" onclick="dayin()">打印</button>
</div>
<form class="layui-form tiao" lay-filter="component-form-group" style="position:relative;font-size:14px!important;top:-80px">

    <label class="tit0" style="top:30mm;left:45mm">寄存证编号： </label><label id='zhengNO' style="top:30mm;left:75mm;font-size:20px"></label>
    <label class="tit0" style="top:50mm;left:45mm">逝者姓名：</label><label id='xm0' style="top:50mm;left:75mm"></label>
    <label class="tit0" style="top:50mm;left:123mm">性别：</label><label id='xb0' style="top:50mm;left:139mm"></label>
    <label class="tit0" style="top:60mm;left:45mm">寄存内容：</label><label id='nr0' style="top:60mm;left:75mm"></label>
    <label class="tit0" style="top:60mm;left:117mm">骨灰盒：</label><label id='nr10' style="top:60mm;left:135mm"></label>
    <label class="tit0" style="top:68mm;left:45mm">寄存时间：</label>
    <label id='az_nian0' style="top:68mm;left:79mm"></label><label class="tit0" style="top:68mm;left:95mm">年</label>
    <label id='az_yue0' style="top:68mm;left:105mm"></label><label class="tit0" style="top:68mm;left:113mm">月</label>
    <label id='az_ri0' style="top:68mm;left:118mm"></label><label class="tit0" style="top:68mm;left:129mm">日</label>
    <label id='az_nian_d0' style="top:78mm;left:79mm"></label><label class="tit0" style="top:78mm;left:95mm">年</label>
    <label id='az_yue_d0' style="top:78mm;left:105mm"></label><label class="tit0" style="top:78mm;left:113mm">月</label>
    <label id='az_ri_d0' style="top:78mm;left:118mm"></label><label class="tit0" style="top:78mm;left:129mm">日</label>

    <label class="tit0" style="top:100mm;left:45mm">逝者姓名：</label><label id='xm1' style="top:100mm;left:75mm"></label>
    <label class="tit0" style="top:100mm;left:123mm">性别：</label><label id='xb1' style="top:100mm;left:139mm"></label>
    <label class="tit0" style="top:110mm;left:45mm">寄存内容：</label><label id='nr1' style="top:110mm;left:75mm"></label>
    <label class="tit0" style="top:110mm;left:117mm">骨灰盒：</label><label id='nr11' style="top:110mm;left:135mm"></label>
    <label class="tit0" style="top:120mm;left:45mm">寄存时间：</label>
    <label id='az_nian1' style="top:120mm;left:79mm"></label><label class="tit0" style="top:120mm;left:95mm">年</label>
    <label id='az_yue1' style="top:120mm;left:105mm"></label><label class="tit0" style="top:120mm;left:113mm">月</label>
    <label id='az_ri1' style="top:120mm;left:118mm"></label><label class="tit0" style="top:120mm;left:129mm">日</label>
    <label class="tit0" style="top:160mm;left:45mm">安葬位置：</label><label id='wz' style="top:160mm;left:75mm"></label>
    <label class="tit0" style="top:30mm;left:166mm">持证人姓名：</label><label id='czr_n' style="top:30mm;left:208mm"></label>
    <label class="tit0" style="top:30mm;left:250mm">性别：</label><label id='czr_s' style="top:30mm;left:265mm;width: 200mm;"></label>
    <label class="tit0" style="top:38mm;left:166mm">与</label><label id='czr_y' style="top:38mm;left:173mm"></label>
    <label class="tit0" style="top:38mm;left:250mm">关系：</label><label id='czr_g' style="top:38mm;left:265mm;width: 200mm;"></label>
    <label class="tit0" style="top:50mm;left:166mm">身份证件类型：</label><label id='czr_t' style="top:50mm;left:204mm"></label>
    <label class="tit0" style="top:60mm;left:166mm">身份证件号：</label><label id='czr_to' style="top:60mm;left:204mm"></label>
    <label class="tit0" style="top:70mm;left:166mm">持证人电话：</label><label id='czr_p' style="top:70mm;left:204mm"></label>
    <label class="tit0" style="top:80mm;left:166mm">住   　   　址：</label> <label id='czr_a' style="top:80mm;left:204mm"></label>
    <div id="jf0" style="top:141mm;left:166mm;position:relative;display:none">
        <span id="nian"></span><label class="tit0" style="top:111mm;left:60mm">年</label>
        <span id="yue" style="position:absolute;left:18mm"></span><label class="tit0" style="top:111mm;left:60mm" >月</label>
        <span id="ri"style="position:absolute;left:32mm"></span><label class="tit0"  style="top:111mm;left:60mm">日</label>
    </div>
    <label class="tit0" style="top:145mm;left:166mm">发 证 日 期：</label><label id='rq' style="top:145mm;left:206mm"></label>
    <label class="tit0" style="top:160mm;left:166mm">发证单位电话：</label><label id='dh' style="top:160mm;left:206mm">82841666</label>
    <label id='lbuda' style="top:99mm;left:180mm;display:none;border:1px solid #000;padding:3px 8px;font-size:18px;font-weight:bold">补发</label>
</form>

<script type="text/javascript" src="__STATIC__/js/lodop/LodopFuncs.js?v={:time()}"></script>
<script src="__TMPL__/public/assets/js/jquery-1.10.2.min.js"></script>
<script>
    var mwid;
    $(function () {
        var mz = JSON.parse(localStorage.getItem("mz"));
        if (mz.did > 0) {
            $("#daall").html('<input type="radio" name="dashui" value="3"  />全部重打');
        }
        else {
            $("#daall").html('<input type="radio" name="dashui" value="3"   />打印全部');
        }
        mwid = mz.czr.mwid;

        $("#czr_n").html(mz.czr.czr_name);
        $("#czr_s").html(mz.czr.czr_sex);
        $("#czr_y").html(mz.czr.cart_type);
        $("#czr_g").html(mz.czr.cart_type);
        $("#czr_t").html(mz.czr.cart_type);
        $("#czr_to").html(mz.czr.czr_cart_no);
        $("#czr_p").html(mz.czr.czr_dh);
        $("#czr_a").html(mz.czr.czr_zz);
        $("#wz").html(mz.czr.wz);
        $("#daczr").show();


        $("#jbr").html(mz.jbr);
        $("#nian").html(mz.nian);
        $("#yue").html(mz.yue);
        $("#ri").html(mz.ri);
        $("#mw").html(mz.czr.w);
        $("#zhengNO").html(mz.czr.num);
        $("#darq").show();
        $("#daall").show();
        if (mz.czr.riqi_1 != null) {
            var syr0 = mz.czr.riqi_1.split("-");
            $("#nian0").html(syr0[0]);
            $("#yue0").html(syr0[1]);
            $("#ri0").html(syr0[2]);
        }
        if (mz.czr.riqi_2 != null) {
            var syr1 = mz.czr.riqi_2.split("-");
            $("#nian1").html(syr1[0]);
            $("#yue1").html(syr1[1]);
            $("#ri1").html(syr1[2]);
        }
        if (mz.sz.length > 0) {
            if (mz.sz[0].name != "") {
                $("#xm0").html(mz.sz[0].name);
                $("#xb0").html(mz.sz[0].sex);
                $("#nr0").html(mz.sz[0].nr);
                $("#az_nian0").html(mz.sz[0].az_nian);
                $("#az_yue0").html(mz.sz[0].az_yue);
                $("#az_ri0").html(mz.sz[0].az_ri);
                $("#az_nian_d0").html(mz.sz[0].end_az_nian);
                $("#az_yue_d0").html(mz.sz[0].end_az_yue);
                $("#az_ri_d0").html(mz.sz[0].end_az_ri);
                $("#da0").append((mz.sz[0].zheng == 1 ? "补打-" : "打印-") + mz.sz[0].name);
                $("#da0").attr("gid", mz.sz[0].id);
                $("#da0").show();
            }
        }
        if (mz.sz.length > 1) {
            $("#xm1").html(mz.sz[1].name);
            $("#xb1").html(mz.sz[1].sex);
            $("#nr1").html(mz.sz[1].nr);
            $("#az_nian1").html(mz.sz[1].az_nian);
            $("#az_yue1").html(mz.sz[1].az_yue);
            $("#az_ri1").html(mz.sz[1].az_ri);
            $("#da1").append((mz.sz[1].zheng==1?"补打-":"打印-") + mz.sz[1].name);
            $("#da1").attr("gid",mz.sz[1].id);
            $("#da1").show();
        }
        $(":radio[name='dashui']").click(function () {
            $("label#lbuda").hide();
            $("label#lbuda").addClass("tit");
            console.log(this.value)
            if (this.value == 0) {
                Preview1(mz.sz[0])
            }else if (this.value == 1){
                Preview2(mz.sz[1])
            }else if (this.value == 5){
                Preview3(mz.czr)
            }else if (this.value == 3){
                Preview4(mz.sz[0],mz.sz[1],mz.czr)
            }else if (this.value == 3){
                $("label#lbuda").show();
                $("label#lbuda").removeClass("tit");
                Preview5()
            }
        });
        $(":checkbox[name='bda']").click(function () {
            if (this.checked) {
                $("label#lbuda").show();
                $("label#lbuda").removeClass("tit");
            }
            else {
                $("label#lbuda").hide();
                $("label#lbuda").addClass("tit");
            }
        });
    });
    function Preview1(sz) {
        LODOP=getLodop();
        LODOP.SET_PRINTER_INDEX("EPSON LQ-520K ESC/P2");//指定打印机
        LODOP.SET_PRINT_PAGESIZE(0,0,0,"18.6*15.5-zheng");
        CreatePrintPageSz1(sz)
        // LODOP.PREVIEW();//
        LODOP.PRINT_DESIGN();//打印设计
    }
    function Preview2(sz) {
        LODOP=getLodop();
        LODOP.SET_PRINTER_INDEX("EPSON LQ-520K ESC/P2");//指定打印机
        LODOP.SET_PRINT_PAGESIZE(0,0,0,"18.6*15.5-zheng");
        CreatePrintPageSz2(sz)
        LODOP.PREVIEW();
    }
    function Preview3(czr) {
        LODOP=getLodop();
        LODOP.SET_PRINTER_INDEX("EPSON LQ-520K ESC/P2");//指定打印机
        LODOP.SET_PRINT_PAGESIZE(0,0,0,"18.6*15.5-zheng");
        CreatePrintPageczr(czr)
        // LODOP.SET_PREVIEW_WINDOW(0,1,0,900,1000,"");//打印前弹出选择打印机的对话框
        // LODOP.SET_PRINT_MODE("AUTO_CLOSE_PREWINDOW",1);//打印后自动关闭预览窗口
        LODOP.PREVIEW();//
        // LODOP.PRINT_DESIGN();//打印设计
    }
    function Preview4(sz0,sz1,czr) {
        LODOP=getLodop();
        LODOP.SET_PRINTER_INDEX("EPSON LQ-520K ESC/P2");//指定打印机
        LODOP.SET_PRINT_PAGESIZE(0,0,0,"18.6*15.5-zheng");
        if (sz0){
            CreatePrintPageSz1(sz0)
        }
        if (sz1) {
            CreatePrintPageSz2(sz1)
        }
        CreatePrintPageczr(czr)
        // LODOP.SET_PREVIEW_WINDOW(0,1,0,900,1000,"");//打印前弹出选择打印机的对话框
        // LODOP.SET_PRINT_MODE("AUTO_CLOSE_PREWINDOW",1);//打印后自动关闭预览窗口
        LODOP.PREVIEW();//
        // LODOP.PRINT_DESIGN();//打印设计
    }
    function Preview5() {
        LODOP=getLodop();
        LODOP.SET_PRINTER_INDEX("EPSON LQ-520K ESC/P2");//指定打印机
        LODOP.SET_PRINT_PAGESIZE(0,0,0,"18.6*15.5-zheng");
        LODOP.ADD_PRINT_TEXT(270,428,63,35,"补发");
        LODOP.SET_PRINT_STYLEA(0,"FontSize",16);
        // LODOP.SET_PREVIEW_WINDOW(0,1,0,900,1000,"");//打印前弹出选择打印机的对话框
        // LODOP.SET_PRINT_MODE("AUTO_CLOSE_PREWINDOW",1);//打印后自动关闭预览窗口
        LODOP.PREVIEW();//
        // LODOP.PRINT_DESIGN();//打印设计
    }


    function CreatePrintPageSz1(sz){
        LODOP.ADD_PRINT_TEXT(107,151,76,25,sz.name);
        LODOP.SET_PRINT_STYLEA(0,"FontSize",11);
        LODOP.ADD_PRINT_TEXT(107,291,34,25,sz.sex);
        LODOP.SET_PRINT_STYLEA(0,"FontSize",11);
        LODOP.ADD_PRINT_TEXT(132,150,100,23,sz.nr);
        LODOP.ADD_PRINT_TEXT(133,292,100,20,"");//
        LODOP.SET_PRINT_STYLEA(0,"FontSize",11);
        LODOP.ADD_PRINT_TEXT(157,152,60,25,sz.az_nian);
        LODOP.SET_PRINT_STYLEA(0,"FontSize",11);
        LODOP.ADD_PRINT_TEXT(156,215,38,25,sz.az_yue);
        LODOP.SET_PRINT_STYLEA(0,"FontSize",11);
        LODOP.ADD_PRINT_TEXT(153,268,35,25,sz.az_ri);
        LODOP.SET_PRINT_STYLEA(0,"FontSize",11);
        LODOP.ADD_PRINT_TEXT(182,152,60,27,sz.end_az_nian);
        LODOP.SET_PRINT_STYLEA(0,"FontSize",11);
        LODOP.ADD_PRINT_TEXT(182,215,38,27,sz.end_az_yue);
        LODOP.SET_PRINT_STYLEA(0,"FontSize",11);
        LODOP.ADD_PRINT_TEXT(182,268,35,27,sz.end_az_ri);
        LODOP.SET_PRINT_STYLEA(0,"FontSize",11);
    }
    function CreatePrintPageSz2(sz){
        LODOP.ADD_PRINT_TEXT(231,148,76,25,sz.name);
        LODOP.SET_PRINT_STYLEA(0,"FontSize",11);
        LODOP.ADD_PRINT_TEXT(231,288,34,25,sz.sex);
        LODOP.SET_PRINT_STYLEA(0,"FontSize",11);
        LODOP.ADD_PRINT_TEXT(257,147,100,23,sz.nr);
        LODOP.SET_PRINT_STYLEA(0,"FontSize",11);
        LODOP.ADD_PRINT_TEXT(281,149,60,25,sz.az_nian);
        LODOP.SET_PRINT_STYLEA(0,"FontSize",11);
        LODOP.ADD_PRINT_TEXT(280,212,38,25,sz.az_yue);
        LODOP.SET_PRINT_STYLEA(0,"FontSize",11);
        LODOP.ADD_PRINT_TEXT(277,265,35,25,sz.az_ri);
        LODOP.SET_PRINT_STYLEA(0,"FontSize",11);
    }
    function CreatePrintPageczr(czr){
        LODOP=getLodop();
        LODOP.ADD_PRINT_TEXT(63,145,194,25,czr.num);
        LODOP.SET_PRINT_STYLEA(0,"FontSize",11);
        LODOP.ADD_PRINT_TEXT(62,450,85,23,czr.czr_name);
        LODOP.ADD_PRINT_TEXT(64,596,34,21,czr.czr_sex);
        LODOP.SET_PRINT_STYLEA(0,"FontSize",11);
        LODOP.ADD_PRINT_TEXT(117,463,100,23,czr.cart_type);
        LODOP.ADD_PRINT_TEXT(83,596,67,23,czr.cart_type);
        LODOP.ADD_PRINT_TEXT(88,398,156,23,czr.cart_type);
        LODOP.ADD_PRINT_TEXT(147,453,175,23,czr.czr_cart_no);
        LODOP.ADD_PRINT_TEXT(172,448,100,24,czr.czr_dh);
        LODOP.ADD_PRINT_TEXT(205,447,100,17,czr.czr_zz);
        LODOP.ADD_PRINT_TEXT(400,142,201,23,czr.wz);
        LODOP.ADD_PRINT_TEXT(368,492,132,26,czr.sg);
        LODOP.SET_PRINT_STYLEA(0,"FontSize",13);
        LODOP.ADD_PRINT_TEXT(389,492,132,24,"82841666");
        LODOP.SET_PRINT_STYLEA(0,"FontSize",14);
    }
</script>
</body>
</html>